package com.idanchuang.support.jboss.access.log;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

/**
 * @author yjy
 * Created at 2022/2/24 12:19 下午
 */
public class Access {

    /**
     * 服务
     */
    String appId;
    /**
     * 服务版本
     */
    String version;
    /**
     * 服务分组
     */
    String group;
    /**
     * 请求开始时间
     */
    String time;
    /**
     * 请求开始时间
     */
    long timestamp;
    /**
     * 请求host
     */
    String host;
    /**
     * 服务端口
     */
    int port;
    /**
     * 链路id
     */
    String traceId;
    /**
     * skywalking 的traceId
     */
    String skyId;
    /**
     * apm 的 traceId
     */
    String apmId;
    /**
     * 服务地址
     */
    String serverAddr;
    /**
     * http响应码
     */
    int status;
    /**
     * 响应延迟
     */
    long requestTime;
    /**
     * url
     */
    String url;
    /**
     * 请求类型
     */
    String method;
    /**
     * 请求参数
     */
    String query;
    /**
     * 请求方式
     */
    String requestMethod;
    /**
     * 请求协议
     */
    String protocol;
    /**
     * 调用方ip
     */
    String clientIp;
    /**
     * 真实源ip
     */
    String realClientIp;
    /**
     * 调用方
     */
    String rpcFrom;
    /**
     * 调用方分组
     */
    String fromGroup;
    /**
     * 调用方接口
     */
    String fromApi;
    /**
     * 调用方应用版本
     */
    String fromVersion;
    /**
     * 错误信息
     */
    String resultMsg;
    /**
     * 业务码
     */
    String resultCode;
    /**
     * 业务码-短码
     */
    int shortCode;
    /**
     * 是否压测请求 0否 1是
     */
    int pressure;
    /**
     * 用户id
     */
    String userId;
    /**
     * 请求头
     */
    String headers;
    /**
     * 请求体
     */
    String request;
    /**
     * 响应结果
     */
    String result;
    /**
     * 来源页面
     */
    String referer;
    /**
     * 客户端信息
     */
    String userAgent;
    /**
     * 链路入口path
     */
    String originReq;

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public int getPressure() {
        return pressure;
    }

    public void setPressure(int pressure) {
        this.pressure = pressure;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }

    public String getUserId() {
        return userId;
    }

    public String getFromApi() {
        return fromApi;
    }

    public void setFromApi(String fromApi) {
        this.fromApi = fromApi;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getReferer() {
        return referer;
    }

    public void setReferer(String referer) {
        this.referer = referer;
    }

    public String getUserAgent() {
        return userAgent;
    }

    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public int getShortCode() {
        return shortCode;
    }

    public void setShortCode(int shortCode) {
        this.shortCode = shortCode;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getApmId() {
        return apmId;
    }

    public void setApmId(String apmId) {
        this.apmId = apmId;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getFromGroup() {
        return fromGroup;
    }

    public void setFromGroup(String fromGroup) {
        this.fromGroup = fromGroup;
    }

    public String getFromVersion() {
        return fromVersion;
    }

    public String getHeaders() {
        return headers;
    }

    public void setHeaders(String headers) {
        this.headers = headers;
    }

    public void setFromVersion(String fromVersion) {
        this.fromVersion = fromVersion;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public String getServerAddr() {
        return serverAddr;
    }

    public void setServerAddr(String serverAddr) {
        this.serverAddr = serverAddr;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public long getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(long requestTime) {
        this.requestTime = requestTime;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getQuery() {
        return query;
    }

    public void setQuery(String query) {
        this.query = query;
    }

    public String getRequestMethod() {
        return requestMethod;
    }

    public void setRequestMethod(String requestMethod) {
        this.requestMethod = requestMethod;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public String getRealClientIp() {
        return realClientIp;
    }

    public void setRealClientIp(String realClientIp) {
        this.realClientIp = realClientIp;
    }

    public String getRpcFrom() {
        return rpcFrom;
    }

    public String getSkyId() {
        return skyId;
    }

    public void setSkyId(String skyId) {
        this.skyId = skyId;
    }

    public String getOriginReq() {
        return originReq;
    }

    public void setOriginReq(String originReq) {
        this.originReq = originReq;
    }

    public void setRpcFrom(String rpcFrom) {
        this.rpcFrom = rpcFrom;
    }

    public String getRequest() {
        return request;
    }

    public void setRequest(String request) {
        this.request = request;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this, SerializerFeature.IgnoreNonFieldGetter);
    }


}
